const AboutusModel = require('../db/models/aboutus');

//关于我们数据服务
class AboutusService {
    async addAboutusData(data) {
        const aid = data.aid;
        const result = await AboutusModel.findOne({
            where: { aid }
        });
        if (result) {
            return await AboutusModel.update(data, {
                where: { aid }
            });
        } else {
            return await AboutusModel.create(data);
        }
    }
}

module.exports = new AboutusService()